<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>File Source for QueryPathExtensionTests.php</title>
	<link rel="stylesheet" type="text/css" href="../media/style.css">
	<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
	<script src="media/a.js"></script>
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
	<td class="header-top-left"><img src="../media/logo.png" border="0" alt="phpDocumentor " /></td>
    <td class="header-top-right">Tests<br /><div class="header-top-right-subpackage"></div></td>
  </tr>
  <tr><td colspan="2" class="header-line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td colspan="2" class="header-menu">
      
                                                    
                      		[ <a href="../classtrees_Tests.html" class="menu">class tree: Tests</a> ]
		[ <a href="../elementindex_Tests.html" class="menu">index: Tests</a> ]
            [ <a href="../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td colspan="2" class="header-line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="195" class="menu">
		<div class="package-title">Tests</div>
  <div class="package">
	<div id="todolist">
			<p><a href="../todolist.html">Todo List</a></p>
	</div>
	</div>
      <b>Packages:</b><br />
  <div class="package">
              <a href="../li_QueryPath.html">QueryPath</a><br />
              <a href="../li_Examples.html">Examples</a><br />
              <a href="../li_Tests.html">Tests</a><br />
      	</div>
      <br />
                        <br />
                      </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<h1 align="center">Source for file QueryPathExtensionTests.php</h1>
<p>Documentation is available at <a href="../Tests/_test---QueryPathExtensionTests.php.html">QueryPathExtensionTests.php</a></p>
<div class="src-code"><span class="php">
<ol><li><div class="src-line"><a name="a1"></a><span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line"><a name="a2"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a3"></a><span class="src-doc">&nbsp;*&nbsp;Tests&nbsp;for&nbsp;the&nbsp;QueryPath&nbsp;library.</span></div></li>
<li><div class="src-line"><a name="a4"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@package</span><span class="src-doc">&nbsp;Tests</span></div></li>
<li><div class="src-line"><a name="a5"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@author</span><span class="src-doc">&nbsp;M&nbsp;Butcher&nbsp;&lt;matt@aleph-null.tv&gt;</span></div></li>
<li><div class="src-line"><a name="a6"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@license</span><span class="src-doc">&nbsp;The&nbsp;GNU&nbsp;Lesser&nbsp;GPL&nbsp;(LGPL)&nbsp;or&nbsp;an&nbsp;MIT-like&nbsp;license.</span></div></li>
<li><div class="src-line"><a name="a7"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a8"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a9"></a><span class="src-inc">require_once&nbsp;</span><span class="src-str">'PHPUnit/Framework.php'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a10"></a><span class="src-inc">require_once&nbsp;</span><span class="src-str">'../src/QueryPath/QueryPath.php'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a11"></a><span class="src-inc">require_once&nbsp;</span><span class="src-str">'./QueryPathTests.php'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a12"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a13"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a14"></a><span class="src-doc">&nbsp;*&nbsp;Run&nbsp;all&nbsp;of&nbsp;the&nbsp;usual&nbsp;tests,&nbsp;plus&nbsp;some&nbsp;extras,&nbsp;with&nbsp;some&nbsp;extensions&nbsp;loaded.</span></div></li>
<li><div class="src-line"><a name="a15"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a16"></a><span class="src-key">class&nbsp;</span><a href="../Tests/QueryPathExtensionTests.html">QueryPathExtensionTests</a>&nbsp;<span class="src-key">extends&nbsp;</span><a href="../Tests/QueryPathTests.html">QueryPathTests</a>&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a17"></a>&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathExtensionTests.html#methodtestExtensions">testExtensions</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a18"></a>&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertNotNull</span><span class="src-sym">(</span><a href="../QueryPath/_src---QueryPath---QueryPath.php.html#functionqp">qp</a><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a19"></a>&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a20"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a21"></a>&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathExtensionTests.html#methodtestStubToe">testStubToe</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a22"></a>&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="../QueryPath/_src---QueryPath---QueryPath.php.html#functionqp">qp</a><span class="src-sym">(</span><span class="src-str">'./data.xml'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'unary'</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">stubToe</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">':root&nbsp;&gt;&nbsp;toe'</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">size</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a23"></a>&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a24"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a25"></a>&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathExtensionTests.html#methodtestStuble">testStuble</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a26"></a>&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'arg1arg2'</span><span class="src-sym">,&nbsp;</span><a href="../QueryPath/_src---QueryPath---QueryPath.php.html#functionqp">qp</a><span class="src-sym">(</span><span class="src-str">'./data.xml'</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">stuble</span><span class="src-sym">(</span><span class="src-str">'arg1'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'arg2'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a27"></a>&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a28"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a29"></a>&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a30"></a><span class="src-doc">&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-tag">@expectedException</span><span class="src-doc">&nbsp;QueryPathException</span></div></li>
<li><div class="src-line"><a name="a31"></a><span class="src-doc">&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a32"></a>&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathExtensionTests.html#methodtestCallFailure">testCallFailure</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a33"></a>&nbsp;&nbsp;&nbsp;<a href="../QueryPath/_src---QueryPath---QueryPath.php.html#functionqp">qp</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">foo</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a34"></a>&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a35"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a36"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a37"></a><span class="src-comm">//&nbsp;Create&nbsp;a&nbsp;stub&nbsp;extension:</span></div></li>
<li><div class="src-line"><a name="a38"></a><span class="src-key">class&nbsp;</span><a href="../Tests/StubExtensionOne.html">StubExtensionOne</a>&nbsp;<span class="src-key">implements&nbsp;</span><a href="../QueryPath/QueryPathExtension.html">QueryPathExtension</a>&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a39"></a>&nbsp;&nbsp;<span class="src-key">private&nbsp;</span><span class="src-var">$qp&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a40"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/StubExtensionOne.html#method__construct">__construct</a><span class="src-sym">(</span><span class="src-id">QueryPath&nbsp;</span><span class="src-var">$qp</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a41"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">qp&nbsp;</span>=&nbsp;<span class="src-var">$qp</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a42"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a43"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a44"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/StubExtensionOne.html#methodstubToe">stubToe</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a45"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">qp</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">':root'</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">append</span><span class="src-sym">(</span><span class="src-str">'&lt;toe/&gt;'</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">end</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a46"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">qp</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a47"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a48"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a49"></a><span class="src-key">class&nbsp;</span><a href="../Tests/StubExtensionTwo.html">StubExtensionTwo</a>&nbsp;<span class="src-key">implements&nbsp;</span><a href="../QueryPath/QueryPathExtension.html">QueryPathExtension</a>&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a50"></a>&nbsp;&nbsp;<span class="src-key">private&nbsp;</span><span class="src-var">$qp&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a51"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/StubExtensionTwo.html#method__construct">__construct</a><span class="src-sym">(</span><span class="src-id">QueryPath&nbsp;</span><span class="src-var">$qp</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a52"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">qp&nbsp;</span>=&nbsp;<span class="src-var">$qp</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a53"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a54"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/StubExtensionTwo.html#methodstuble">stuble</a><span class="src-sym">(</span><span class="src-var">$arg1</span><span class="src-sym">,&nbsp;</span><span class="src-var">$arg2</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a55"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$arg1&nbsp;</span>.&nbsp;<span class="src-var">$arg2</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a56"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a57"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a58"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a59"></a><span class="src-id"><a href="../QueryPath/QueryPathExtensionRegistry.html">QueryPathExtensionRegistry</a></span><span class="src-sym">::</span><a href="../QueryPath/QueryPathExtensionRegistry.html#methodextend">extend</a><span class="src-sym">(</span><span class="src-str">'StubExtensionOne'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a60"></a><span class="src-id"><a href="../QueryPath/QueryPathExtensionRegistry.html">QueryPathExtensionRegistry</a></span><span class="src-sym">::</span><a href="../QueryPath/QueryPathExtensionRegistry.html#methodextend">extend</a><span class="src-sym">(</span><span class="src-str">'StubExtensionTwo'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
</ol>
</span></div>
        <div class="credit">
		    <hr class="separator" />
		    Documentation generated on Thu, 19 Mar 2009 18:01:20 -0500 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.2</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>